package com.aspose.cells;

class zeu {
   static zagu a(int var0, zagu[] var1, zaay var2) {
      double[] var5 = new double[1];
      zyz var6 = zaaq.a(var1, var2, 0, (double[])var5, 7);
      if (var6 != null) {
         return var6;
      } else {
         double var3 = var5[0];
         if (var3 >= 0.0D && var3 <= 2958465.99D) {
            if (var3 == 0.0D) {
               switch(var0) {
               case 68:
                  return new zyy(1.0D);
               case 69:
                  return new zyy(1900.0D);
               default:
                  return new zyy(0.0D);
               }
            } else {
               DateTime var7 = var2.b(var3);
               switch(var0) {
               case 67:
                  return new zyy((double)var7.getDay());
               case 68:
                  return new zyy((double)var7.getMonth());
               case 69:
                  return new zyy((double)var7.getYear());
               case 70:
               default:
                  return null;
               case 71:
                  return new zyy((double)var7.getHour());
               case 72:
                  return new zyy((double)var7.getMinute());
               case 73:
                  return new zyy(var7.getMillisecond() > 500 ? (double)(var7.getSecond() + 1) : (double)var7.getSecond());
               }
            }
         } else {
            return zze.a;
         }
      }
   }

   static zagu a(int var0, zagu[] var1, zaay var2, int var3, int var4) {
      DateTime[] var5 = new DateTime[var3];
      zyz var6 = zaaq.a(var1, var2, 0, (DateTime[])var5, var4);
      if (var6 != null) {
         return var6;
      } else {
         double[] var7 = null;
         if (var1.length > var3) {
            var7 = new double[var1.length - var3];
            var6 = zaaq.a(var1, var2, var3, var7, var4);
            if (var6 != null) {
               return var6;
            }
         }

         DateTime var9;
         DateTime var15;
         switch(var0) {
         case 70:
            var15 = var5[0];
            if (var15.getYear() < 1900 || var15.getYear() == 1900 && var15.getMonth() < 3) {
               var15 = var2.b(var2.b(var15) - 1.0D);
            }

            return var7 != null ? a((int)var7[0], var15.getDayOfWeek()) : a(1, var15.getDayOfWeek());
         case 449:
            return var2.a(var5[0].addMonths((int)var7[0]));
         case 450:
            var15 = var5[0];
            if (var15.getMonth() != 12) {
               var9 = new DateTime(var15.getYear(), var15.getMonth() + 1, 1);
            } else {
               var9 = new DateTime(var15.getYear() + 1, 1, 1);
            }

            return var2.a(var9.addMonths((int)var7[0]).addDays(-1.0D));
         case 465:
            int var8 = 0;
            if (var7 != null) {
               switch((int)var7[0]) {
               case 1:
               case 17:
                  break;
               case 2:
               case 11:
                  var8 = 1;
                  break;
               case 3:
               case 4:
               case 5:
               case 6:
               case 7:
               case 8:
               case 9:
               case 10:
               case 18:
               case 19:
               case 20:
               default:
                  return zze.a;
               case 12:
               case 13:
               case 14:
               case 15:
               case 16:
                  var8 = (int)var7[0] - 10;
                  break;
               case 21:
                  var9 = var5[0];
                  DateTime var10 = new DateTime(var9.addDays((double)(3 - var9.addDays(-1.0D).getDayOfWeek())).getYear(), 1, 3);
                  return new zyy((double)((com.aspose.cells.a.c.zk.e(var9, var10).b() + var10.getDayOfWeek() + 6) / 7));
               }
            }

            var9 = new DateTime(var5[0].getYear(), 1, 1);
            com.aspose.cells.b.a.zk var16 = com.aspose.cells.a.c.zk.e(var5[0], var9);
            int var11 = (int)var16.c() + 1;
            int var12 = var9.getDayOfWeek();
            boolean var13 = false;
            int var17;
            if (var8 == var12) {
               var17 = 7;
            } else if (var8 < var12) {
               var17 = 7 - (var12 - var8);
            } else {
               var17 = var8 - var12;
            }

            if (var11 <= var17) {
               return zyy.b;
            }

            var11 -= var17;
            int var14 = var11 / 7 + 1;
            if (var11 % 7 != 0) {
               ++var14;
            }

            return new zyy((double)var14);
         default:
            return null;
         }
      }
   }

   private static zagu a(int var0, int var1) {
      switch(var0) {
      case 1:
      case 17:
         ++var1;
         break;
      case 2:
         if (var1 == 0) {
            var1 = 7;
         }
         break;
      case 3:
         if (var1 == 0) {
            var1 = 6;
         } else {
            --var1;
         }
         break;
      case 4:
      case 5:
      case 6:
      case 7:
      case 8:
      case 9:
      case 10:
      default:
         return zze.a;
      case 11:
      case 12:
      case 13:
      case 14:
      case 15:
      case 16:
         var1 -= var0 % 10 - 1;
         if (var1 <= 0) {
            var1 += 7;
         }
      }

      return new zyy((double)var1);
   }

   static zagu a(zagu[] var0, zaay var1) {
      double[] var2 = new double[2];
      zyz var3 = zaaq.a(var0, var1, 0, (double[])var2, 7);
      if (var3 != null) {
         return var3;
      } else if (var1.a(var2[0]) && var1.a(var2[1])) {
         boolean var4 = false;
         if (var0.length > 2) {
            boolean[] var5 = new boolean[1];
            var3 = zaaq.a(var0, var1, 2, (boolean[])var5);
            if (var3 != null) {
               return var3;
            }

            var4 = var5[0];
         }

         return new zyy((double)a((int)var2[0], (int)var2[1], var4, var1));
      } else {
         return zze.a;
      }
   }

   static zagu b(zagu[] var0, zaay var1) {
      double[] var4 = new double[2];
      zyz var5 = zaaq.a(var0, var1, 0, (double[])var4, 7);
      if (var5 != null) {
         return var5;
      } else {
         int var2 = (int)var4[0];
         int var3 = (int)var4[1];
         String[] var12 = new String[1];
         zyz var6 = zaaq.a(var0, var1, 2, (String[])var12);
         if (var6 != null) {
            return var6;
         } else {
            String var11 = var12[0].toUpperCase();
            if (var2 <= var3 && var2 >= 0) {
               if (var11.equals("D")) {
                  return new zyy((double)(var3 - var2));
               }

               DateTime var13;
               DateTime var14;
               byte var15;
               if (var11.equals("Y")) {
                  var13 = var1.b((double)var2);
                  var14 = var1.b((double)var3);
                  var15 = 0;
                  if (var13.getMonth() > var14.getMonth()) {
                     var15 = -1;
                  } else if (var13.getMonth() == var14.getMonth() && var13.getDay() > var14.getDay()) {
                     var15 = -1;
                  }

                  return new zyy((double)(var14.getYear() - var13.getYear()) + (double)var15);
               }

               int var7;
               if (var11.equals("M")) {
                  var13 = var1.b((double)var2);
                  var14 = var1.b((double)var3);
                  var7 = var14.getDay() < var13.getDay() ? -1 : 0;
                  return new zyy((double)((var14.getYear() - var13.getYear()) * 12 + var14.getMonth() - var13.getMonth()) + (double)var7);
               }

               int var8;
               if (var11.equals("YD")) {
                  var13 = var1.b((double)var2);
                  var14 = var1.b((double)var3);
                  var15 = 0;
                  if (var13.getMonth() > var14.getMonth()) {
                     var15 = -1;
                  } else if (var13.getMonth() == var14.getMonth() && var13.getDay() > var14.getDay()) {
                     var15 = -1;
                  }

                  var8 = var14.getYear() - var13.getYear() + var15;
                  var13 = var13.addYears(var8);
                  int var9 = var14.getYear();
                  byte var10 = 0;
                  if ((var9 % 400 == 0 || var9 % 4 == 0 && var9 % 100 != 0) && var14.getMonth() >= 3) {
                     if (var14.getYear() == var13.getYear()) {
                        if (var13.getMonth() == 2 && var13.getDay() == 1) {
                           var10 = 1;
                        } else if (var13.getMonth() == 1) {
                           var10 = 1;
                        }
                     } else if (var14.getYear() > var13.getYear()) {
                        var10 = 1;
                     }
                  }

                  return new zyy((double)var3 - var1.b(var13) - (double)var10);
               }

               if (var11.equals("MD")) {
                  var13 = var1.b((double)var2);
                  var14 = var1.b((double)var3);
                  var7 = var14.getDay() < var13.getDay() ? -1 : 0;
                  var8 = (var14.getYear() - var13.getYear()) * 12 + var14.getMonth() - var13.getMonth() + var7;
                  var13 = var13.addMonths(var8);
                  return new zyy((double)var3 - var1.b(var13));
               }

               if (var11.equals("YM")) {
                  var13 = var1.b((double)var2);
                  var14 = var1.b((double)var3);
                  var7 = var14.getDay() < var13.getDay() ? -1 : 0;
                  var8 = var14.getMonth() - var13.getMonth();
                  if (var8 == 0 && var7 < 0) {
                     return new zyy(11.0D);
                  }

                  return new zyy(var8 < 0 ? (double)(var8 + 12 + var7) : (double)(var8 + var7));
               }
            }

            return zze.a;
         }
      }
   }

   static zagu c(zagu[] var0, zaay var1) {
      double[] var2 = new double[2];
      zyz var3 = zaaq.a(var0, var1, 0, (double[])var2, 7);
      if (var3 != null) {
         return var3;
      } else {
         return (zagu)(var1.a(var2[0]) && var1.a(var2[1]) ? new zyy(Math.ceil(var2[0] - var2[1])) : zze.a);
      }
   }

   static zagu d(zagu[] var0, zaay var1) {
      double[] var4 = new double[2];
      zyz var5 = zaaq.a(var0, var1, 0, (double[])var4, 7);
      if (var5 != null) {
         return var5;
      } else if (!var1.a(var4[0])) {
         return zze.a;
      } else {
         int var2 = (int)var4[0];
         int var3 = (int)var4[1];
         int[] var6 = null;
         if (var0.length > 2 && var0[2] != zzk.a) {
            Object var7 = a(var2, var3, var0[2], var1);
            if (var7 != null) {
               if (var7 instanceof zagu) {
                  return (zagu)var7;
               }

               var6 = (int[])((int[])var7);
            }
         }

         return (zagu)(var3 == 0 ? new zyy((double)var2) : a(var2, var3, (int[])var6, var1, 65));
      }
   }

   private static zagu a(int var0, int var1, int[] var2, zaay var3, int var4) {
      int var5 = 7 - a(var4);
      int var6;
      int var7;
      DateTime var8;
      if (var1 > 0) {
         var6 = 0;
         if (var2 != null) {
            var6 = com.aspose.cells.b.a.za.a(var2, var0);
            if (var6 < 0) {
               var6 = -var6 - 1;
            }
         }

         if (var1 >= var5) {
            var0 += var1 / var5 * 7;
            var7 = var1 % var5;
            if (var2 != null && var6 < var2.length) {
               label115:
               while(true) {
                  while(var6 >= var2.length || var2[var6] > var0) {
                     if (var7 < var5) {
                        break label115;
                     }

                     var0 += var7 / var5 * 7;
                     var7 %= var5;
                  }

                  if ((var4 & 64 >> var3.b((double)var2[var6]).getDayOfWeek()) == 0) {
                     ++var7;
                  }

                  ++var6;
               }
            }

            if (var7 == 0) {
               var8 = var3.b((double)var0);
               if ((var4 & 64 >> var8.getDayOfWeek()) != 0) {
                  do {
                     var8 = var8.addDays(-1.0D);
                     --var0;
                  } while((var4 & 64 >> var8.getDayOfWeek()) != 0);
               }

               return new zyy((double)var0);
            }
         } else {
            var7 = var1;
         }

         var8 = var3.b((double)var0);

         while(true) {
            while(true) {
               var8 = var8.addDays(1.0D);
               ++var0;
               if (var2 != null && var6 < var2.length && var2[var6] == var0) {
                  ++var6;
               } else if ((var4 & 64 >> var8.getDayOfWeek()) == 0) {
                  --var7;
                  if (var7 < 1) {
                     return new zyy((double)var0);
                  }
               }
            }
         }
      } else {
         var1 = -var1;
         var6 = 0;
         if (var2 != null) {
            var6 = com.aspose.cells.b.a.za.a(var2, var0);
            if (var6 < 0) {
               var6 = -var6 - 2;
            }
         }

         if (var1 >= var5) {
            var0 -= var1 / var5 * 7;
            if (var0 < 0) {
               return zze.a;
            }

            var7 = var1 % var5;
            if (var2 != null && var6 > -1) {
               label149:
               while(true) {
                  while(var6 <= -1 || var2[var6] < var0) {
                     if (var7 < var5) {
                        break label149;
                     }

                     var0 -= var7 / var5 * 7;
                     if (var0 < 0) {
                        return zze.a;
                     }

                     var7 %= var5;
                  }

                  if ((var4 & 64 >> var3.b((double)var2[var6]).getDayOfWeek()) == 0) {
                     ++var7;
                  }

                  --var6;
               }
            }

            if (var7 == 0) {
               var8 = var3.b((double)var0);
               if ((var4 & 64 >> var8.getDayOfWeek()) != 0) {
                  do {
                     var8 = var8.addDays(1.0D);
                     ++var0;
                  } while((var4 & 64 >> var8.getDayOfWeek()) != 0);
               }

               return new zyy((double)var0);
            }
         } else {
            var7 = var1;
         }

         var8 = var3.b((double)var0);

         while(true) {
            while(var7 > 0) {
               var8 = var8.addDays(-1.0D);
               --var0;
               if (var0 < 0) {
                  return zze.a;
               }

               if (var2 != null && var6 < var2.length && var2[var6] == var0) {
                  --var6;
               } else if ((var4 & 64 >> var8.getDayOfWeek()) == 0) {
                  --var7;
               }
            }

            return new zyy((double)var0);
         }
      }
   }

   private static Object a(int var0, int var1, zagu var2, zaay var3) {
      zahn var4 = var2.a(var3, false);
      if (var4.b() == 0) {
         return var4.a(0, 0);
      } else {
         double[] var5 = new double[var4.e()];
         var4.f();
         var2 = zaaq.a(var4, var5, var3, 5 | (zsk.b(zst.i) & 255) << 4 | '\uf000');
         var4.a(true);
         var4 = null;
         if (var2.b() == 0) {
            return var2;
         } else {
            com.aspose.cells.b.a.za.a(var5);
            int var6 = 0;
            boolean var7 = var1 < 0;
            boolean var8 = var1 == 0;
            int[] var9 = null;
            if (!var8) {
               var9 = new int[var5.length];
            }

            int var11 = 0;
            double[] var12 = var5;
            int var13 = var5.length;

            for(int var14 = 0; var14 < var13; ++var14) {
               double var15 = var12[var14];
               if (!var3.a(var15)) {
                  return zze.a;
               }

               if (!var8) {
                  int var10 = (int)var15;
                  if (var10 != var11) {
                     var11 = var10;
                     if (var7) {
                        if (var10 >= var0) {
                           continue;
                        }
                     } else if (var10 <= var0) {
                        continue;
                     }

                     var9[var6] = var10;
                     ++var6;
                  }
               }
            }

            if (!var8 && var6 >= 1) {
               if (var6 < var9.length) {
                  int[] var17 = new int[var6];
                  System.arraycopy(var9, 0, var17, 0, var6);
                  return var17;
               } else {
                  return var9;
               }
            } else {
               return null;
            }
         }
      }
   }

   private static int a(int var0) {
      int var1 = 0;

      for(int var2 = 0; var2 < 7; ++var2) {
         if ((var0 & 1 << var2) != 0) {
            ++var1;
         }
      }

      return var1;
   }

   static zagu e(zagu[] var0, zaay var1) {
      double[] var4 = new double[2];
      zyz var5 = zaaq.a(var0, var1, 0, (double[])var4, 7);
      if (var5 != null) {
         return var5;
      } else if (!var1.a(var4[0])) {
         return zze.a;
      } else {
         int var2 = (int)var4[0];
         int var3 = (int)var4[1];
         Object var9 = null;
         if (var3 == 0) {
            return new zyy((double)var2);
         } else {
            int[] var6 = null;
            int var7 = 65;
            if (var0.length > 2) {
               zagu var10 = var0[2].e(var1);
               if (var10 == zzk.a) {
                  return zze.a;
               }

               var10 = a(var10);
               if (var10.b() != 3) {
                  return var10;
               }

               var7 = (int)((zyy)var10).k();
               if (var7 == 127) {
                  return zzg.a;
               }

               if (var0.length > 3) {
                  Object var8 = a(var2, var3, var0[3], var1);
                  if (var8 != null) {
                     if (var8 instanceof zagu) {
                        return (zagu)var8;
                     }

                     var6 = (int[])((int[])var8);
                  }
               }
            }

            return a(var2, var3, var6, var1, var7);
         }
      }
   }

   private static zagu a(zagu var0) {
      if (var0.b() != 3) {
         if (var0.b() == 2) {
            String var2 = ((zaam)var0).k();
            if (var2.length() != 7) {
               return zze.a;
            } else {
               var2 = var2.charAt(6) + var2.substring(0, 6);
               var2 = zev.a(var2);
               return (zagu)(var2 == null ? zze.a : new zyy((double)com.aspose.cells.b.a.ze.b(var2, 2)));
            }
         } else {
            return zzg.a;
         }
      } else {
         int var1 = (int)((zyy)var0).k();
         switch(var1) {
         case 1:
            var1 = 65;
            break;
         case 2:
            var1 = 96;
            break;
         case 11:
            var1 = 64;
            break;
         default:
            if (var1 > 2 && var1 < 8) {
               var1 = 96 >> var1 - 2;
            } else {
               if (var1 <= 11 || var1 >= 18) {
                  return zze.a;
               }

               var1 = 64 >> var1 - 11;
            }
         }

         return new zyy((double)var1);
      }
   }

   static zagu f(zagu[] var0, zaay var1) {
      boolean var4 = false;
      double[] var5 = new double[2];
      zyz var6 = zaaq.a(var0, var1, 0, (double[])var5, 7);
      if (var6 != null) {
         return var6;
      } else if (var1.a(var5[0]) && var1.a(var5[1])) {
         int var2 = (int)var5[0];
         int var3 = (int)var5[1];
         if (var2 > var3) {
            var4 = true;
            var3 = var2;
            var2 = (int)var5[1];
         }

         int var7 = 0;
         if (var0.length > 2 && var0[2] != zzk.a) {
            zagu var9 = a(var2, var3, (zagu)var0[2], var1, 65);
            if (var9.b() == 0) {
               return var9;
            }

            var7 = (int)((zyy)var9).k();
         }

         int var8 = a(var2, var3, var1, 65);
         return new zyy(var4 ? (double)(var7 - var8) : (double)(var8 - var7));
      } else {
         return zze.a;
      }
   }

   private static zagu a(int var0, int var1, zagu var2, zaay var3, int var4) {
      zahn var5 = var2.a(var3, false);
      if (var5.b() == 0) {
         return var5.a(0, 0);
      } else {
         int var6 = 0;
         double[] var7 = new double[var5.e()];
         var5.f();
         var2 = zaaq.a(var5, var7, var3, 5 | (zsk.b(zst.i) & 255) << 4 | '\uf000');
         var5.a(true);
         var5 = null;
         if (var2.b() == 0) {
            return var2;
         } else {
            com.aspose.cells.b.a.za.a(var7);
            int var9 = 0;
            double[] var10 = var7;
            int var11 = var7.length;

            for(int var12 = 0; var12 < var11; ++var12) {
               double var13 = var10[var12];
               if (!var3.a(var13)) {
                  return zze.a;
               }

               int var8 = (int)var13;
               if (var8 >= var0 && var8 <= var1 && var8 != var9) {
                  var9 = var8;
                  if ((var4 & 64 >> var3.b((double)var8).getDayOfWeek()) == 0) {
                     ++var6;
                  }
               }
            }

            return new zyy((double)var6);
         }
      }
   }

   static zagu g(zagu[] var0, zaay var1) {
      boolean var4 = false;
      double[] var5 = new double[2];
      zyz var6 = zaaq.a(var0, var1, 0, (double[])var5, 7);
      if (var6 != null) {
         return var6;
      } else if (var1.a(var5[0]) && var1.a(var5[1])) {
         int var2 = (int)var5[0];
         int var3 = (int)var5[1];
         if (var2 > var3) {
            var4 = true;
            var3 = var2;
            var2 = (int)var5[1];
         }

         int var7 = 65;
         int var8 = 0;
         if (var0.length > 2) {
            zagu var10 = var0[2].e(var1);
            if (var10 == zzk.a) {
               return zze.a;
            }

            var10 = a(var10);
            if (var10.b() != 3) {
               return var10;
            }

            var7 = (int)((zyy)var10).k();
            if (var0.length > 3 && var0[3] != zzk.a) {
               var10 = a(var2, var3, var0[3], var1, var7);
               if (var10.b() == 0) {
                  return var10;
               }

               var8 = (int)((zyy)var10).k();
            }
         }

         if (var7 == 127) {
            return zyy.a;
         } else {
            int var9 = a(var2, var3, var1, var7);
            return new zyy(var4 ? (double)(var8 - var9) : (double)(var9 - var8));
         }
      } else {
         return zze.a;
      }
   }

   private static int a(int var0, int var1, zaay var2, int var3) {
      if (var1 == var0) {
         return (var3 & 64 >> var2.b((double)var0).getDayOfWeek()) == 0 ? 1 : 0;
      } else {
         int var4 = 7 - a(var3);
         int var5 = var1 - var0 + 1;
         int var6 = var5 % 7;
         var5 = var5 / 7 * var4;
         if (var6 == 0) {
            return var5;
         } else {
            DateTime var7 = var2.b((double)(var1 - var6 + 1));
            if ((var3 & 64 >> var7.getDayOfWeek()) == 0) {
               ++var5;
            }

            --var6;

            for(; var6 > 0; --var6) {
               var7 = var7.addDays(1.0D);
               if ((var3 & 64 >> var7.getDayOfWeek()) == 0) {
                  ++var5;
               }
            }

            return var5;
         }
      }
   }

   static zagu h(zagu[] var0, zaay var1) {
      int var4 = 0;
      double[] var5 = new double[var0.length];
      zyz var6 = zaaq.a(var0, var1, 0, (double[])var5, 7);
      if (var6 != null) {
         return var6;
      } else if (var1.a(var5[0]) && var1.a(var5[1])) {
         int var2 = (int)var5[0];
         int var3 = (int)var5[1];
         if (var2 > var3) {
            var3 = var2;
            var2 = (int)var5[1];
         }

         if (var5.length > 2) {
            var4 = (int)var5[2];
         }

         switch(var4) {
         case 0:
            return new zyy((double)a(var2, var3, false, var1) / 360.0D);
         case 1:
            if (var2 == var3) {
               return new zyy(0.0D);
            }

            return new zyy((double)(var3 - var2) / a(var1.b((double)var2), var1.b((double)var3)));
         case 2:
            return new zyy((double)(var3 - var2) / 360.0D);
         case 3:
            return new zyy((double)(var3 - var2) / 365.0D);
         case 4:
            if (var2 == var3) {
               return new zyy(0.0D);
            }

            return new zyy((double)a(var2, var3, true, var1) / 360.0D);
         default:
            return zze.a;
         }
      } else {
         return zze.a;
      }
   }

   private static int a(int var0, int var1, boolean var2, zaay var3) {
      if (var0 == var1) {
         return 0;
      } else {
         int var4 = 0;
         if ((double)var0 == 60.0D) {
            ++var0;
            ++var4;
         }

         DateTime var5 = var3.b((double)var0);
         DateTime var6 = var3.b((double)var1);
         boolean var7 = false;
         if (var6.getDay() == 29 && var6.getMonth() == 2 && DateTime.a(var6.getYear())) {
            var7 = true;
         }

         int var8 = var6.getYear() - var5.getYear();
         var6 = var6.addYears(var5.getYear() - var6.getYear());
         if (com.aspose.cells.a.c.zk.d(var6, var5)) {
            var6 = var6.addYears(1);
            var4 += 360 * (var8 - 1);
            if (var7) {
               ++var4;
            }
         } else {
            var4 += 360 * var8;
            if (var7 && !DateTime.a(var6.getYear())) {
               ++var4;
            }
         }

         if (var6.getYear() > var5.getYear()) {
            var4 += (var6.getMonth() - 1) * 30;
            var4 += var6.getDay();
            if (var6.getDay() == 31) {
               if (!var2) {
                  if (var5.getDay() == 30 || var5.getDay() == 31) {
                     --var4;
                  }
               } else {
                  --var4;
               }
            }

            var4 += (13 - var5.getMonth()) * 30 - var5.getDay();
            if (var5.getDay() == 31) {
               ++var4;
            }
         } else {
            var4 += (var6.getMonth() - var5.getMonth()) * 30 + var6.getDay() - var5.getDay();
            switch(var5.getDay()) {
            case 28:
               if (!var2 && var5.getMonth() == 2 && var5.getYear() != 1900 && !DateTime.a(var5.getYear())) {
                  var4 -= 2;
               }
               break;
            case 29:
               if (!var2 && var5.getMonth() == 2 && DateTime.a(var5.getYear())) {
                  --var4;
               }
            case 30:
            default:
               break;
            case 31:
               ++var4;
            }

            if (var6.getDay() == 31) {
               if (!var2) {
                  if (var5.getDay() == 30 || var5.getDay() == 31) {
                     --var4;
                  }
               } else {
                  --var4;
               }
            }
         }

         return var4;
      }
   }

   private static double a(DateTime var0, DateTime var1) {
      int var2 = var0.getYear();
      int var3 = var1.getYear();
      boolean var4 = true;
      int var5;
      if (var4) {
         var5 = var3 - var2 + 1;
         var0 = new DateTime(var2, 1, 1);
         var1 = new DateTime(var3 + 1, 1, 1);
         com.aspose.cells.b.a.zk var9 = com.aspose.cells.a.c.zk.e(var1, var0);
         int var10 = (int)var9.c();
         return (double)var10 / (double)var5;
      } else {
         var5 = var3 - var2;
         DateTime var6 = new DateTime(var3, var0.getMonth(), var0.getDay());
         com.aspose.cells.b.a.zk var7 = com.aspose.cells.a.c.zk.e(var6, var0);
         int var8 = (int)var7.c() + 1;
         return (double)var8 / (double)var5;
      }
   }
}
